<{include file="header.html"}>
<{include file="top.html"}>
<div class="h_980 clearfix">  
            <div class="FosfMain">
            <div class="page_dh"><a class="location-home" href="<{spUrl c=main a=index}>"></a> <{$title}></div>
                	<h1><{$news.detail.news_name}></h1> 
                    <div class="new_text">
                        <{$news.detail.news_description}>
                    </div>
                    <div class="clear"></div>
                    <script type="text/javascript">
                    $(document).ready(function(){
                    			$('#sendmail').click(function(){
                    			var formdata = {
                    			'contactname' : $('#contactname').val(),
                    			'email-address' : $('#email-address').val(),
                    			'enquiry': $('#enquiry').val()
                    		      };
                    			$("#result").ajaxSend(function(e,xhr,opt){
                    			$(this).html("Loading.....");
                    			});
                    			$.getJSON("<{spUrl c=main a=ContactUsSave}>?action=send", formdata, function(json){
                                        if(json.status=='y'){
                                          $('#sendmail').css('display','none');
                                        };
                                     $('#result').css('display','block');                  			 
                    			     $('#result').html(json.info);
                                 
                                }); 
                    		});
                    });
                    
                    //验证邮箱，正确返回true，错误返回false
                    function checkEmail(email){
                    var emailRegExp = new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");
                    if (!emailRegExp.test(email)||email.indexOf('.')==-1){
                    return false;
                    }else{
                    return true;
                    }
                    }
                    //验证输入框内信息，并给出对应提示
                    function test(obj){
                    if(obj=="email"){
                    var email=$.trim($("input[name='email']").val());
                    if(email==""){
                    $("#alert").html("<{T w="Mail can't for empty!"}>");
                    //$("#tishi_mail p").addClass("tsTxt_error");
                    }else{
                    if(!checkEmail(email)){
                    $("#alert").html("<{T w='Please enter the commonly used E-mail!'}>");
                    //$("#tishi_mail p").addClass("tsTxt_error");
                    }else{
                    $("#alert").html("OK!");
                    //$("#tishi_mail p").addClass("tsTxt");
                    };
                    }
                    
                    }
                    };
                    </script>
                    
                    
                    <fieldset id="contactUsForm">
                    <legend><{T w='Contact Us'}></legend>
                    <div class="alert"><{T w='* Required information'}></div>
                    <div id="result">232</div>
                    <label class="inputLabel" for="contactname"><{T w='Full Name'}>:</label>
                    <input type="text" name="contactname" class="Fosfinput"  size="40" id="contactname" /><span class="alert">*</span><br class="clear" />
                    
                    <label class="inputLabel" for="email-address"><{T w='Email Address'}>:</label>
                    <input type="text" name="email" class="Fosfinput"  size="40" id="email-address" onblur="test('email')" /><span class="alert">*</span><br class="clear" />
                    
                    <label class="inputLabel" for="enquiry"><{T w='Message'}>:<span class="alert">*</span></label>
                    <textarea name="enquiry" id="enquiry"></textarea>
                    </fieldset>
                    
                    <div class="buttonRow forward"><input type="image" src="<{$smarty.const.BASEPATH}>/css/img/button_send.gif" alt="<{T w='Send Now'}>" title=" <{T w='Send Now'}> " id="sendmail" /></div>
                    <div class="buttonRow back"><a href="<{$smarty.const.WEBURL}>"><img src="<{$smarty.const.BASEPATH}>/css/img/button_back.gif" alt="<{T w='Back'}>" title=" <{T w='Back'}> "/></a></div>
                </div><br class="clear"/>
    
</div>  
<{include file="footer.html"}>
</body>
</html>